﻿from django.http import HttpResponse,HttpResponseNotFound
from LczWeb.settings import *
import datetime
import os
def current_datetime(request):
    now=datetime.datetime.now()
    html='<html><body>It is now %s.5</body></html>' % now
    print('hahah')
    
    return HttpResponse(html)
def imginfo(request):
    s='ssssss'
    with open(r'D:\lcz\demo\pythonDemo\LczWeb\static\a.jpg','rb') as r:
        print(r)
    #html='<html><body>%s%s</body></html>' % (BASE_DIR,'\static\a.jpg')
    html='<html><body>%s</body></html>' % 'D:\lcz\demo\pythonDemo\LczWeb\static\aaa.jpg'
    return HttpResponse(r'D:\lcz\demo\pythonDemo\LczWeb\static\aaa.jpg')
def v_int(request,int):
    return HttpResponse('获取到参数int：%s 类型:%s' % (int,type(int).__name__))
def v_yyyy(request,int):
    return HttpResponse('获取到参数yyyy：%s 类型:%s' % (int,type(int).__name__))

def v_int_int(request,year,month):    
    return HttpResponse('获取到参数year：%s  month:%s' % (year,month))
def v_str(request,str):    
    return HttpResponse('获取到参数str：%s 类型:%s' % (int,type(str).__name__))
def v_slug(request,slug):    
    return HttpResponse('获取到参数slug：%s 类型:%s' % (int,type(slug).__name__))
def v_path(request,path):    
    return HttpResponse('获取到参数path：%s 类型:%s' % (int,type(path).__name__))